package io.renren.modules.generator.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.EnterpriseSafeMonitorDao;
import io.renren.modules.generator.entity.EnterpriseSafeMonitorEntity;
import io.renren.modules.generator.service.EnterpriseSafeMonitorService;


@Service("enterpriseSafeMonitorService")
public class EnterpriseSafeMonitorServiceImpl extends ServiceImpl<EnterpriseSafeMonitorDao, EnterpriseSafeMonitorEntity> implements EnterpriseSafeMonitorService {

    @Autowired
    private EnterpriseSafeMonitorDao enterpriseSafeMonitorDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<EnterpriseSafeMonitorEntity> page = this.page(
                new Query<EnterpriseSafeMonitorEntity>().getPage(params),
                new QueryWrapper<EnterpriseSafeMonitorEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<EnterpriseSafeMonitorEntity> selectList(EnterpriseSafeMonitorEntity enterpriseSafeMonitorEntity) {
        QueryWrapper<EnterpriseSafeMonitorEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(EnterpriseSafeMonitorEntity::getEnterpriseId,enterpriseSafeMonitorEntity.getEnterpriseId());
        return enterpriseSafeMonitorDao.selectList(queryWrapper);
    }

}